#ifndef ABSTRACTCURVE_H
#define ABSTRACTCURVE_H

#include <QByteArray>

namespace CurveEditor {

class RandomCurve;

typedef enum _curve_type{
    CURVE_RANDOM,
    CURVE_LINE,
    CURVE_SIN,
    CURVE_TRI,
    CURVE_SQUARE,
}CurveType;

class AbstractCurve
{
public:
    AbstractCurve(CurveType type);
    virtual ~AbstractCurve();

    CurveType curveType();

    virtual RandomCurve toRandomCurve() = 0;
    virtual void validate() = 0;
    virtual bool isValid() = 0;

private:
    CurveType m_type;
};

class RandomCurve : public AbstractCurve
{
public:
    RandomCurve(const QByteArray &data = QByteArray());
    ~RandomCurve();

    virtual RandomCurve toRandomCurve(){return *this;}
    virtual void validate();
    virtual bool isValid();

    void setRandomData(const QByteArray &data);

private:
    QByteArray *m_data;
};

} // CurveEditor

#endif // ABSTRACTCURVE_H
